package com.qf.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author q
 * @version V1.0
 * @date 2022/01/20
 **/
@RestController
@RequestMapping("/site")
@RefreshScope   //配置中心内容发生变化，则可以直接获取到 【异步通信】
public class SiteProController {

    @Value("${server.port}")
    private String port;

    @Value("${jdbc.username}")
    private String jdbcUsername;

    @GetMapping("/helloNacos")
    public String helloNacos(String name){
        return port + " site-provider-8101 --> " + name + " jdbcUsername ->" + jdbcUsername;
    }

}
